package com.blog.backend.resp;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * @author fanggongsai
 * @description
 * @Date 2021-07-17
 */
@Setter
@Getter
public class ArticleResp  implements Serializable {

    private static final long serialVersionUID = 7263984821450411938L;

    @ApiModelProperty("文章主键id")
    private String articleId;

    @ApiModelProperty("文章标题")
    private String articleName;

    @ApiModelProperty("文章点赞数")
    private Integer commentNumber;

    @ApiModelProperty("文章点赞数")
    private Integer browseNumber;

    @JsonIgnore
    private Date createTime;

    @ApiModelProperty("文章内容")
    private String articleContent;

    @JsonIgnore
    private String label;

    @ApiModelProperty("板块名称")
    private String plateName;

    @ApiModelProperty("标签列表")
    private List<TagResp> labelList;

    @ApiModelProperty("编写时间")
    private String time;

    @ApiModelProperty("昵称")
    private String nickName;

    private String plateId;

    private String imageUrl;

    private String imageId;

    private String articleDescription;

    private String recommend;

    private String draftName;

    public String getTime() {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        String timeFormat = format.format(this.createTime);
        return timeFormat;
    }

}
